<template>
	<view class="content">
		<view class="header">
			<view :style="{height: systemBarHeight + 'px'}">
			</view>

			<view class="navbar">
				<image src="/static/xy/fh1.png" mode="" @click="fh()"></image>
				<text>修改密码</text>
			</view>

			<view class="tit">
				<text>修改密码</text>
			</view>
			<view class="tit1">
				<text>输入旧密码验证后，输入新密码保存即可修改成功！</text>
			</view>

			<view class="page">

				<view class="passtit">
					<text>请输入旧密码</text>
				</view>
				<view class="password_ipt">
					<view class="ipt">
						<input type="text" value="oldpasswrod" @input="oldInput" v-model="oldpasswrod"
							:password="oldpasswrodshow" placeholder="请输入旧密码" placeholder-class="oldinput" />
					</view>
					<view class="img1">
						<image src="/static/xy/shanchu.png" v-show="oldshanchu" mode="" @click="olddelect()"></image>
					</view>

					<view class="img2">
						<image src="/static/xy/yincang.png" mode="" v-if="oldpasswrodshow==false" @click="old()">
						</image>
						<image src="/static/xy/chakan.png" mode="" v-if="oldpasswrodshow==true" @click="old()"></image>
					</view>
				</view>

				<view class="passtit1">
					<text>请输入新密码</text>
				</view>

				<view class="password_ipt">
					<view class="ipt">
						<input type="text" value="newpasswrod" @input="newInput" v-model="newpasswrod"
							:password="newpasswrodshow" placeholder="请输入新密码" placeholder-class="oldinput" />
					</view>
					<view class="img1">
						<image src="/static/xy/shanchu.png" v-show="newshanchu" mode="" @click="newdelect()"></image>
					</view>

					<view class="img2">
						<image src="/static/xy/yincang.png" mode="" v-if="newpasswrodshow==false" @click="newpa()">
						</image>
						<image src="/static/xy/chakan.png" mode="" v-if="newpasswrodshow==true" @click="newpa()">
						</image>
					</view>
				</view>
				<view class="passtit1">
					<text>请再次输入新密码</text>
				</view>

				<view class="password_ipt">
					<view class="ipt">
						<input type="text" value="oldpasswrod" @input="newnewInput" v-model="newnewpassword"
							:password="newnewpasswordshow	" placeholder="请输入新密码" placeholder-class="oldinput" />
					</view>
					<view class="img1">
						<image src="/static/xy/shanchu.png" v-show="newnewshanchu" mode="" @click="newnewdelect()">
						</image>
					</view>

					<view class="img2">
						<image src="/static/xy/yincang.png" mode="" v-if="newnewpasswordshow==false" @click="newnew()">
						</image>
						<image src="/static/xy/chakan.png" mode="" v-if="newnewpasswordshow==true" @click="newnew()">
						</image>
					</view>
				</view>
				
				<view class="bt">
					<text>	修改</text>
				</view>
			</view>
			
			
			
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				systemBarHeight: 0,
				oldpasswrod: '',
				newpasswrod: '',
				newnewpassword: '',
				newnewpasswordshow: true,
				newpasswrodshow: true,
				oldpasswrodshow: true,
				oldshanchu: false,
				newshanchu: false,
				newnewshanchu: false
			}
		},
		mounted() {
			/* 手机顶部高度 */
			this.getSysteminfo()
			this.oldInput()

		},
		methods: {
			/* 手机顶部高度 */
			getSysteminfo() {
				uni.getSystemInfo({
					success: res => {
						this.systemBarHeight = res.statusBarHeight;
					}
				});
			},
			fh() {
				uni.navigateBack({
					delta: 1
				})
			},
			old() {
				this.oldpasswrodshow = !this.oldpasswrodshow
			},
			oldInput(e) {
				let that = this
				console.log(that.oldpasswrod)

				if (that.oldpasswrod === "") {
					console.log(that.oldshanchu)
					that.oldshanchu = false
				} else {

					that.oldshanchu = true
					console.log(that.oldshanchu)
				}
			},
			olddelect() {
				this.oldpasswrod = ""
				this.oldInput()
			},
			newpa() {
				this.newpasswrodshow = !this.newpasswrodshow
			},
			newInput() {
				let that = this
				if (that.newpasswrod === "") {
					that.newshanchu = false
				} else {
					that.newshanchu = true
				}
			},
			newdelect() {
				this.newpasswrod = ""
				this.newInput()
			},
			newnew() {
				this.newnewpasswordshow = !this.newnewpasswordshow
			},
			newnewInput() {
				let that = this
				if (that.newnewpassword === "") {
					that.newnewshanchu = false
				} else {
					that.newnewshanchu = true
				}
			},

			newnewdelect() {
				this.newnewpassword = ""
				this.newnewInput()
			}

		}
	}
</script>

<style lang="scss" scoped>
	.content {
		height: 100vh;
	}

	.header {
		width: 750rpx;
		height: 1624rpx;
		background: linear-gradient(180deg, #30DE9B 0%, #FFFFFF 100%), #FFFFFF;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
	}

	.navbar {
		height: 88rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		position: relative;

		>image {
			width: 48rpx;
			height: 48rpx;
			position: absolute;
			left: 32rpx;
		}

		>text {
			font-family: PingFang SC, PingFang SC;
			font-weight: 600;
			font-size: 34rpx;
			color: #FFFFFF;
		}
	}

	.tit {
		width: 92%;
		margin: 64rpx auto 0;

		font-family: PingFang SC, PingFang SC;
		font-weight: 500;
		font-size: 56rpx;
		color: #FFFFFF;
	}

	.tit1 {
		width: 92%;
		margin: 16rpx auto 0;
		font-family: PingFang SC, PingFang SC;
		font-weight: 400;
		font-size: 28rpx;
		color: #FFFFFF;
	}

	.page {
		padding-top: 64rpx;
		margin-top: 40rpx;
		height: 1210rpx;
		background: #FFFFFF;
		border-radius: 48rpx 48rpx 0rpx 0rpx;

		.passtit {
			width: 92%;
			margin: auto;
			font-family: PingFang SC, PingFang SC;
			font-weight: 500;
			font-size: 32rpx;
			color: #43484D;
		}

		.passtit1 {
			width: 92%;
			margin: 40rpx auto 0;
			font-family: PingFang SC, PingFang SC;
			font-weight: 500;
			font-size: 32rpx;
			color: #43484D;
		}

		.password_ipt {
			margin: 16rpx auto 0;
			display: flex;
			align-items: center;
			width: 92%;
			height: 96rpx;
			border-radius: 16rpx 16rpx 16rpx 16rpx;
			border: 2rpx solid #C2C6C9;

			.ipt {
				>input {
					margin-left: 32rpx;
				}


				/deep/ .oldinput {
					font-family: PingFang SC, PingFang SC;
					font-weight: 400;
					font-size: 28rpx;
					color: #D9D9D9;

				}
			}

			.img1 {
				>image {
					width: 40rpx;
					height: 40rpx;
				}

				margin-left: auto;
				margin-right: 14rpx;
			}

			.img2 {
				margin-right: 32rpx;

				>image {
					width: 40rpx;
					height: 40rpx;
				}
			}
		}

		.password_ipt::after {
			width: 92%;
			height: 96rpx;
			border-radius: 16rpx 16rpx 16rpx 16rpx;
			border: 2rpx solid #53DDA8;
		}
	}
	.bt{
		width: 648rpx;
		height: 96rpx;
		margin: 60rpx auto 0;
		background: #53DDA8;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
		display: flex;
		align-items: center;
		justify-content: center;
	
		font-family: PingFang SC, PingFang SC;
		font-weight: 500;
		font-size: 32rpx;
		color: #FFFFFF;
	}
</style>